package com.ruoyi.web.controller.epm;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.EpmInformation;
import com.ruoyi.system.domain.Time;
import com.ruoyi.system.service.IEpmContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Empment/contract")
public class EpmContractController extends BaseController {
    @Autowired
    private IEpmContractService iEpmContractService;

//    查询合同信息
    @PreAuthorize("@ss.hasPermi('Empment:contract:list')")
    @GetMapping(value = "/{year}/{month}")
    public TableDataInfo getContractDataInfo(@PathVariable("year") int year, @PathVariable("month") int month)
    {
        startPage();
        Time time=new Time();
        time.setMonth(month);
        time.setYear(year);
        List<EpmInformation> data = iEpmContractService.selectEpmInformationByContractData(time);
        return getDataTable(data);
    }


}
